/*
 * @(#)FormElement.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.form.bean;

import com.dcivision.framework.bean.AbstractBaseObject;

/**
 * FormElement.java
 * 
 * This class is the serializable bean reflecting business logic uses.
 * 
 * @author Scott Tong
 * @company DCIVision Limited
 * @creation date 26/12/2003
 * @version $Revision: 1.27.2.1 $
 */

public class FormElement extends AbstractBaseObject {

  public static final String REVISION = "$Revision: 1.27.2.1 $";

  static final long serialVersionUID = -1891472799835429756L;

  private String elementType = null;

  private String dataType = null;

  private String defaultValue = null;

  private Integer defaultStyle = null;

  private String fieldName = null;

  private String isLabel = null;

  private String fieldCaption = null;

  private Integer width = null;

  private Integer height = null;

  private Integer expandable = null;

  private String fontType = null;

  private Integer fontSize = null;

  private String fontStyle = null;

  private String fontColor = null;

  private String labelPosition = null;

  private Integer positionRow = null;

  private Integer positionColumn = null;

  private String requiredFlag = null;

  private String validationRule = null;

  private String uniqueness = null;

  private String isDelete = null;

  private String permission = null;

  private String fileName = null;

  private String formRecordID = null;

  private String formPageID = null;

  private String formSectionID = null;

  private MtmFormDynamicValue dynamicSql = null;

  public static final String LABEL_POSITION_LEFT = "L";

  public static final String LABEL_POSITION_RIGHT = "R";

  public static final String LABEL_POSITION_CENTER = "C";

  public static final String LABEL_POSITION_TOP = "T";

  public static final String LABEL_POSITION_HIDDEN = "H";

  public static final String VALIDATION_ALPHABET_ONLY = "A";

  public static final String VALIDATION_INTEGER_ONLY = "I";

  public static final String VALIDATION_NUMERIC_ONLY = "F";

  private FormSelectionField formSelectionField = null;

  private int optionNumber;

  public FormElement() {
    super();
  }

  public MtmFormDynamicValue getDynamciSql() {
    return this.dynamicSql;
  }

  public void setDynamicSql(MtmFormDynamicValue mtmForDynamciValue) {
    this.dynamicSql = mtmForDynamciValue;
  }

  public String getFileName() {
    return (this.fileName);
  }

  public void setFileName(String fileName) {
    this.fileName = fileName;
  }

  public String getElementType() {
    return (this.elementType);
  }

  public void setElementType(String elementType) {
    this.elementType = elementType;
  }

  public String getDataType() {
    return (this.dataType);
  }

  public void setDataType(String dataType) {
    this.dataType = dataType;
  }

  public String getDefaultValue() {
    return (this.defaultValue);
  }

  public void setDefaultValue(String defaultValue) {
    this.defaultValue = defaultValue;
  }

  public Integer getDefaultStyle() {
    return (this.defaultStyle);
  }

  public void setDefaultStyle(Integer defaultStyle) {
    this.defaultStyle = defaultStyle;
  }

  public String getFieldName() {
    return (this.fieldName);
  }

  public void setFieldName(String fieldName) {
    this.fieldName = fieldName;
  }

  public String getIsLabel() {
    return (this.isLabel);
  }

  public void setIsLabel(String isLabel) {
    this.isLabel = isLabel;
  }

  public String getFieldCaption() {
    return (this.fieldCaption);
  }

  public void setFieldCaption(String fieldCaption) {
    this.fieldCaption = fieldCaption;
  }

  public Integer getWidth() {
    return (this.width);
  }

  public void setWidth(Integer width) {
    this.width = width;
  }

  public Integer getHeight() {
    return (this.height);
  }

  public void setHeight(Integer height) {
    this.height = height;
  }

  public Integer getExpandable() {
    return (this.expandable);
  }

  public void setExpandable(Integer expandable) {
    this.expandable = expandable;
  }

  public String getFontType() {
    return (this.fontType);
  }

  public void setFontType(String fontType) {
    this.fontType = fontType;
  }

  public Integer getFontSize() {
    return (this.fontSize);
  }

  public void setFontSize(Integer fontSize) {
    this.fontSize = fontSize;
  }

  public String getFontStyle() {
    return (this.fontStyle);
  }

  public void setFontStyle(String fontStyle) {
    this.fontStyle = fontStyle;
  }

  public String getFontColor() {
    return (this.fontColor);
  }

  public void setFontColor(String fontColor) {
    this.fontColor = fontColor;
  }

  public String getLabelPosition() {
    return (this.labelPosition);
  }

  public void setLabelPosition(String labelPosition) {
    this.labelPosition = labelPosition;
  }

  public Integer getPositionRow() {
    return (this.positionRow);
  }

  public void setPositionRow(Integer positionRow) {
    this.positionRow = positionRow;
  }

  public Integer getPositionColumn() {
    return (this.positionColumn);
  }

  public void setPositionColumn(Integer positionColumn) {
    this.positionColumn = positionColumn;
  }

  public String getRequiredFlag() {
    return (this.requiredFlag);
  }

  public void setRequiredFlag(String requiredFlag) {
    this.requiredFlag = requiredFlag;
  }

  public String getValidationRule() {
    return (this.validationRule);
  }

  public void setValidationRule(String validationRule) {
    this.validationRule = validationRule;
  }

  public String getUniqueness() {
    return uniqueness;
  }

  public void setUniqueness(String uniqueness) {
    this.uniqueness = uniqueness;
  }

  public FormSelectionField getFormSelectionField() {
    return (this.formSelectionField);
  }

  public void setFormSelectionField(FormSelectionField formSelectionField) {
    this.formSelectionField = formSelectionField;

    if (formSelectionField != null) {
      this.optionNumber = formSelectionField.getFormSelectionFieldOptionList().size();
    }
  }

  public boolean isLeftLabelPosition(String labelPostion) {
    return (this.LABEL_POSITION_LEFT.equals(labelPosition));
  }

  public boolean isRightLabelPosition(String labelPostion) {
    return (this.LABEL_POSITION_RIGHT.equals(labelPosition));
  }

  public boolean isCenterLabelPosition(String labelPostion) {
    return (this.LABEL_POSITION_CENTER.equals(labelPosition));
  }

  public boolean isTopLabelPosition(String labelPostion) {
    return (this.LABEL_POSITION_TOP.equals(labelPosition));
  }

  public boolean isHiddenLabelPosition(String labelPostion) {
    return (this.LABEL_POSITION_HIDDEN.equals(labelPosition));
  }

  public String getFormRecordID() {
    return this.formRecordID;
  }

  public void setFormRecordID(String formRecordID) {
    this.formRecordID = formRecordID;
  }

  public String getFormPageID() {
    return this.formPageID;
  }

  public void setFormPageID(String formPageID) {
    this.formPageID = formPageID;
  }

  public String getFormSectionID() {
    return this.formSectionID;
  }

  public void setFormSectionID(String formSectionID) {
    this.formSectionID = formSectionID;
  }

  public String getIsDelete() {
    return isDelete;
  }

  public void setIsDelete(String isDelete) {
    this.isDelete = isDelete;
  }

  public String getPermission() {
    return permission;
  }

  public void setPermission(String permission) {
    this.permission = permission;
  }

  /**
   * Called by viewer, represent as viewer helper interface.
   */
  public int getOptionNumber() {
    return optionNumber;
  }

  public void setOptionNumber(int optionNumber) {
    this.optionNumber = optionNumber;
  }

}
